package com.xiaoshuidi.cloud.module.member.controller.app.coupon.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xiaoshuidi.cloud.module.member.api.coupon.vo.CouponCustomerInfoVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class CouponSimpleInfoVo {

    @Schema(description = "用户券id")
    private Long id;
    @Schema(description = "可用不可用")
    private Boolean flag;
    @Schema(description = "优惠券id")
    private Long couponId;

    @Schema(description ="优惠券名称")
    private String couponName;

    @Schema(description ="可用费项")
    private String usableFee = "租金可用";
    @Schema(description = "优惠类型 0-立减   1-折扣")
    private Integer preferentialContentType;

    @Schema(description = "优惠金额或者百分比")
    private BigDecimal marginPreference;

    /**
     * 使用叠加 排他[]  1只能与同一优惠可叠加使用["1"] |2 与其他活动可叠加使用["2"] 无限制["1","2"]
     */
    private String couponUseOverlay;
    /**
     * 最低租赁月份
     */
    private Integer miniLeaseMonth;
    /**
     * 最高租赁月份
     */
    private Integer maxLeaseMonth;

    private Date expirationStartTime;
    /**
     * 使用结束时间
     */
    private Date expirationEndTime;

    public CouponSimpleInfoVo(CouponCustomerValidQueryVo item) {
        this.id=item.getId();
        this.couponId = item.getCouponId();
        this.couponName=item.getCouponName();
        this.preferentialContentType = item.getPreferentialContentType();
        this.marginPreference = item.getPreferentialAmount();
        this.couponName = item.getCouponName();
        this.miniLeaseMonth = item.getMiniLeaseMonth();
        this.maxLeaseMonth = item.getMaxLeaseMonth();
        this.couponUseOverlay = item.getCouponUseOverlay();
        this.expirationStartTime=item.getExpirationStartTime();
        this.expirationEndTime=item.getExpirationEndTime();
    }

}
